const mongoose = require("mongoose");
const Schema = mongoose.Schema;

// Create Schema
const UserInfo = new Schema({
  name: {
    type: String,
    required: true,
  },
  number: {
    type: Number,
    required: true,
    default: 789,
  },
  password: {
    type: String,
    required: true,
  },
  score: {
    type: Number,
    default: 0,
  },
  rank: {
    type: Number,
    default: 0,
  },
  role: {
    type: String,
    required: true,
    default: "学生",
  },
});

module.exports = User = mongoose.model("userinfo", UserInfo);
